﻿@using Smartstore.Web.Models.Catalog

@model List<CategorySummaryModel>

@{
    if (Model.Count == 0)
    {
        return; 
    }
}

<div class="artlist artlist-grid artlist-6-cols artlist-boxed artlist-homepage-categories">
    @foreach (var item in Model)
    {
        var image = item.Image;
        var linkTitle = T("Media.Category.ImageLinkTitleFormat", item.Name);

        <article class="art" data-id="@item.Id">
            <div class="art-picture-block">
                @if (image != null && image.HasImage())
                {
                    <a class="art-picture img-center-container" href="@item.Url" title="@linkTitle">
                        <img sm-model="image" loading="lazy" />
                    </a>
                }
            </div>
            <div class="art-genericname">
                <a href="@item.Url" title="@linkTitle">
                    <span sm-language-attributes-for="item.Name">@item.Name</span>
                </a>
            </div>
        </article>
    }
</div>